<?php

/**
 * @author quang
 * @copyright 2011
 */
class User{
    private $id;
    private $uid;
    private $name;
    private $email;
    private $answer = array();
    private $score;
   
    public function setScore($val){
        $this->score = $val;
    }
    public function getScore(){
        return $this->score;
    }
    
    public function setId($val){
        $this->id = $val;
    }
    public function getId(){
        return $this->id;
    }
    
    public function setUid($val){
        $this->uid = $val;
    }
    public function getUid(){
        return $this->uid;
    }
    
    public function setName($val){
        $this->name = $val;
    }
    public function getName(){
        return $this->name;
    }
    
    public function setEmail($val){
        $this->email = $val;
    }
    public function getEmail(){
        return $this->email;
    }
    
    public function addAnswer($val){
        array_push($this->answer, $val);
    }
    public function getAnswer(){
               $answerString= "";
        foreach($this->answer as $ans){
            $answerString .= $ans.",";
        }
        $answerString = substr($answerString, 0 , strlen($answerString)-1);
        return $answerString;
    }
}

class Species{
    private $id;
    private $content_en;
    private $content_fr;
    private $img;
    
    public function __construct($content_en, $content_fr,$img){
        $this->content_en = $content_en;
        $this->content_fr = $content_fr;
        $this->img = $img;
    }
    
    public function setId($id){
        $this->id = $id;
    }
    public function getId(){
        return $this->id;
    }
    
    public function getImg(){
        return $this->img;
    }
    
    public function getContentEn(){
        return $this->content_en;
    }
    
    public function getContentFr(){
        return $this->content_fr;
    }
}

class Quizz{
    private $id;
    private $quiz_en;
    private $quiz_fr;
    private $specyId;
    
    public function __construct($id, $quiz_en, $quiz_fr, $specyId){
        $this->id = $id;
        $this->quiz_en = $quiz_en;
        $this->quiz_fr = $quiz_fr;
        $this->specyId = $specyId;
    }
    
    public function getId(){
        return $this->id;
    }
    
    public function getQuizEn(){
        return $this->quiz_en;
    }
    public function getQuizFr(){
        return $this->quiz_fr;
    }
    
    public function getAnswer(){
        return $this->specyId;
    }    
    
    public function checkAnswer($ans){
        #echo "Checking ";
        #echo " ans ".$ans;
        #echo " specyId ".$this->specyId;
        return $ans==$this->specyId;
    }
}

?>